package com.cskaoyan.market.controller.admin;


import com.cskaoyan.market.annotation.RequiresPermissionsDesc;
import com.cskaoyan.market.db.domain.MarketAddress;
import com.cskaoyan.market.service.AdminAddressService;
import com.cskaoyan.market.util.ResponseUtil;
import org.apache.shiro.authz.annotation.RequiresPermissions;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import javax.servlet.http.HttpServlet;
import java.util.List;

@RestController
@RequestMapping("/admin/address")
public class AdminAddressController extends HttpServlet {

    @Autowired
    AdminAddressService adminAddressService ;


    @GetMapping("list")
    @RequiresPermissions("admin:address:list")
    @RequiresPermissionsDesc(menu = {"会员管理", "收货地址"},button = "查询")
    public Object list(Integer page, Integer limit, String sort, String order, String name, Integer userId) {
        List<MarketAddress> addressList = adminAddressService.list(page,limit,sort,order,name,userId);
       return ResponseUtil.okList(addressList);
    }

}
